<% include ../includes/header %>
<link rel="stylesheet" type="text/css" href="/css/index.css">
</head>
<div class="fix-head">
	<div class="head-content">
		<div class="left-logo">
			<a href="/"><span><!--logo--></span></a>
		</div>
		<div class="search-box">
			<input type="text" placeholder="搜点什么？"><span class="glyphicon glyphicon-search"></span>
		</div>
		<div class="head-nav logo-btn">
			<ul>
				<li><a href="/"><span class="glyphicon glyphicon-home"></span>首页</a></li>
				<li><a href="#"><span class="glyphicon glyphicon-facetime-video"></span>视频</a></li>
				<li><a href="#"><span class="glyphicon glyphicon-eye-open"></span>发现</a></li>
				<li><a href="#"><span class="glyphicon glyphicon-headphones"></span>游戏</a></li>
			</ul>
		</div>
		<div class="log logo-btn">
			<% if(!user){ %>
				<ul>
					<li><a href="/showsignin">注册</a></li>
					<li><a href="/showsignup">登录</a></li>
				</ul>
			<% }else{ %>
				<ul>
					<li><a><span class="glyphicon glyphicon-user"></a></span><a><%= user.name %></a></li>
					<div class="edit-hover">
						<span class="glyphicon glyphicon-cog edit-btn">
						<div class="edit">
							<ul>
								<li><a href="/set/info">账号设置</a></li>
								<li><a href="/set/info">账号设置</a></li>
								<li><a href="/set/info">账号设置</a></li>
								<li><a href="/set/info">账号设置</a></li>
								<li><a href="/set/info">账号设置</a></li>
								<li><a href="/set/info">账号设置</a></li>
								<li><a href="/set/info">账号设置</a></li>
								<li><a href="/set/info">账号设置</a></li>
								<li><a href="/set/info">账号设置</a></li>
								<li><a href="/logout">退出登录</a></li>
								<div class="clear"></div>
							</ul>
						</div>
						<div class="triangle"></div>
					</div>
				</ul>
			<% } %>
		</div>
	</div>
</div>
<div class="container">
	<div class="nav-left">
		<a href="#"><h1>首页</h1></a>
		<a href="#"><h1>我的收藏</h1></a>
		<a href="#"><h1>我的赞</h1></a>
		<div class="line"></div>
		<a href="#"><span class="glyphicon glyphicon-fire"></span><h2>热门微博</h2></a>
		<a href="#"><span class="glyphicon glyphicon-facetime-video"></span><h2>热门视频</h2></a>
		<div class="line"></div>
		<a href="#"><span class="glyphicon glyphicon-heart"></span><h2>好友圈</h2></a>
		<a href="#"><span class="glyphicon glyphicon-zoom-in"></span><h2>特别关注</h2></a>
	</div>
	<div class="middle-content">
		<div class="publish-area">
			<div class="head-title"><h2>有什么新鲜事想告诉大家？</h2></div>
			<form class="login" method="POST" action="/publish" enctype="multipart/form-data">
				<textarea cols="3" name="weibo[content]"></textarea>
				<input type="hidden" name="weibo[from]" value="<%= user._id %>"> 
				<div class="func-area logo-btn">
					<ul>
						<li><a href="#"><span class="glyphicon glyphicon-magnet"></span>表情</a></li>
						<li><a href="#" class="photo-wrap-show"><span class="glyphicon glyphicon-picture"></span>图片</a></li>
						<div class="photo-wrap">
							<i class="glyphicon glyphicon-remove photo-close"></i>
							<h2>本地上传</h2>
							<p>请选择图片文件：JPG/GIF<p>
							<div id="img-wrap">
								<div class="input-box">
									<img class="cover">
									<input type="file" name="img" class="img">
									<span class="glyphicon glyphicon-plus"></span>
								</div>
							</div>
						</div>
						<li><a href="#"><span class="glyphicon glyphicon-facetime-video"></span>视频</a></li>
						<li><a href="#"><span class="glyphicon glyphicon-header"></span>话题</a></li>
						<li><a href="#"><span class="glyphicon glyphicon-align-center"></span>头条文章</a></li>
						<li><a href="#" class="dot">···</a></li>
						<li><a href="#" class="privacy">公开<span class="glyphicon glyphicon-chevron-down"></span></a></li>
						<% if(user){ %>
						<input type="submit" value="发布" id="publish">
						<% }else{ %>
						<a href="/showsignin" id="publish">发布</a>
						<% } %>
					</ul>
				</div>
			</form>
		</div>
		<div class="content-area">
			<div class="head-switch logo-btn">
				<ul>
					<li><a href="#">全部</a></li>
					<li><a href="#">图片</a></li>
					<li><a href="#">视频</a></li>
					<li><a href="#">音乐</a></li>
					<li><a href="#">文章</a></li>
				</ul>		
			</div>
			<% weibos.forEach((weibo)=>{ %>
				<div class="content-box">
					<div class="head-img">
						<a href="#"><img src="/upload/<%= weibo.from.photo %>"></a>
					</div>
					<div class="content">
						<h1><%= weibo.from.name %></h1>
						<p><%= moment(weibo.meta.createAt).fromNow() %> 来自iphone8</p>
						<h2><%= weibo.content %> </h2>
						<div class="img-box">
							<% weibo.imgUrl.forEach((img,index)=>{ %>
								<img src="/upload/<%= img %>" class="weibo-img">
							<% }) %>
						</div>
					</div>
					<div class="content-bottom logo-btn">
						<ul>
							<li><a href="#"><span class="glyphicon glyphicon-star-empty"></span>收藏</a></li>
							<li><a href="#"><span class="glyphicon glyphicon-new-window"></span>转发</a></li>
							<li><a href="#"><span class="glyphicon glyphicon-comment"></span>评论</a></li>
							<li><a href="#"><span class="glyphicon glyphicon-thumbs-up"></span>点赞</a></li>
						</ul>
					</div>
				</div>
			<% }) %>
		</div>
	</div>
	<div class="right-info">
		<div class="personal-info">
			<div class="avatar">
				<img src="/upload/<%= user.photo %>">
			</div>
			<div class="skin">
				<img src="./img/02.jpg">
			</div>
			<div class="info">
				<% if(!user){ %>
				<a href="/userdetail/<%= user._id %>">游侠</a></br>
				<% }else{%>
				<a href="/userdetail/<%= user._id %>"><%= user.name %></a></br>
				<% }%>
				<div class="logo-btn">
					<ul>
						<li><a href="#">145</br></a>关注</li>
						<li><a href="#">1254</br></a>粉丝</li>
						<li><a href="#">657</br></a>微博</li>
					</ul>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="/js/index.js"></script>
</body>
</html>